package tests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import bean.BeanFilm;
import metier.Film;
import DAO.DAOJPA;

public class testBeanFilm {
	
	private Film film1, film2;
	private BeanFilm beanFilm = new BeanFilm();
	
	@Before
	public void init() {
		film1 = new Film("titreFilm",2014,20);
		film2 = new Film("testfilm",2014,20);
		DAOJPA.viderBase();
		beanFilm.setFilm(film1);
		beanFilm.enregistrer();
		beanFilm.setFilm(film2);
		beanFilm.enregistrer();
	}
	
	@Test
	public void testGetFilm(){
	    assertEquals(2, beanFilm.getFilms().size());
	}
	
	/*@Test
	public void testGetFilmNom(){
		String nom = "titreFilm";
	    assertEquals(1, beanFilm.getFilmNom(nom).size());
	}*/
	

}
